import SvgIcon from './SvgIcon/index.vue'
// import Bar from './Visual/Bar.vue'
// import Line from './Visual/Line.vue'
// import Pie from './Visual/Pie.vue'
// import BarIndex from './Visual/BarIndex.vue'
// import BarIndex2 from './Visual/BarIndex2.vue'
// import LeftChart from './Home/left.vue'
// import RightChart from './Home/right.vue'
import LeftTop from './Large/LeftTop.vue'
import CenterTop from './Large/CenterTop.vue'
import LeftBottom from './Large/LeftBottom.vue'
import CenterBottom from './Large/CenterBottom.vue'
import RightTop from './Large/RightTop.vue'
import RightBottom from './Large/RightBottom.vue'

import type { App, Component } from 'vue'
// 注册所有图标组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 注册全局组件
const components: { [name: string]: Component } = {
  SvgIcon,
  LeftTop,
  LeftBottom,
  CenterBottom,
  RightBottom,
  RightTop,
  CenterTop,
}
export default {
  // 一定要叫做install
  install(app: App) {
    Object.keys(components).forEach((key: string) => {
      app.component(key, components[key])
    })
    // 将elementplus提供的图标注册为全局组件
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
}
